package mmoon.mmoonstory.eventhandler;

import mmoon.mmoonstory.MMoonStory;
import mmoon.mmoonstory.MMoonUtils;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.event.entity.EntityEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@Mod.EventBusSubscriber(modid = MMoonStory.MOD_ID)
public class EventEntity {

    @SubscribeEvent
    public static void onEntityConstructing(EntityEvent.EntityConstructing event) {
        final Entity e = event.getEntity();
        if (e instanceof EntityLivingBase) {
            ((EntityLivingBase) e).getAttributeMap().registerAttribute(MMoonUtils.MagicPower);
        }
    }
}
